The Dreamweaver JavaScript API > File manipulation functions > dom.newBlock()

 

dom.newBlock()

Availability

Dreamweaver 3.0

Description

Creates a new block with the same tag and attributes as the block that contains the current selection, or creates a new paragraph if the cursor is outside of all blocks.

Arguments

None.

Returns

Nothing.

Enabler

None.

Example

If the current selection is inside a center-aligned paragraph, a call to dreamweaver.getDocumentDOM().newBlock() inserts <p align="center"> after the current paragraph.